def quickSort(mylist, low, high):
    i = low 
    j = high
    if i >= j:
        return mylist
    key = mylist[i]             # key是分割点,一开始key是虚拟的,没有位置
    while i < j:                # 目标就是比key小的往左边堆, 比key大的往右边堆
        while i < j and key <= mylist[j]:
            j = j-1             # 从右往左推进,遇到比key小则结束推进                                                         
        mylist[i] = mylist[j]   # 并将该小值给赋予左边分支
        while i < j and mylist[i] <= key:    
            i = i+1             # 从左往右推进,遇到比key大则结束推进
        mylist[j] = mylist[i]   # 并将该大值给赋予右边分支
    mylist[i] = key             # 排好了,可以给key赋予位置了,也即分割点的位置
    quickSort(mylist, low, i-1)
    quickSort(mylist, j+1, high)
    return mylist
    
alist = [4,5,1,8,19,2,3]
blist = quickSort(alist, 0, 6)
print(blist)